<template>
  <div class="searchtop">
    <div class="goback" @click="goback()">
      <van-icon name="arrow-left" />
    </div>
    <input type="search" v-focus placeholder="烤肉" />
    <span>搜索</span>
  </div>
</template>

<script>
export default {
  methods: {
    goback() {
      this.$router.go(-1);
    }
  },
  directives: {
    focus: {
      inserted(el) {
        el.focus();
      }
    }
  }
};
</script>

<style lang="scss" scoped>
.searchtop {
  width: 100%;
  height: 13.333vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
  .goback {
    font-size: 5.333vw;
  }
  input {
    height: 8vw;
    padding-left: 4vw;
    outline: none;
    border: none;
    border-radius: 3.733vw;
    background-color: #f0f0f0;
    flex-grow: 1;
    margin: 0 4vw;
    font-size: 3.733vw;
  }
  span {
    font-size: 3.733vw;
  }
}
</style>